package gemini.castor.ui.server.service.impl;

import gemini.basic.manager.DistributorManager;
import gemini.basic.model.Customer;
import gemini.castor.ui.client.service.CustomerService;
import gemini.castor.ui.server.service.AbstractSingleService;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CustomerServiceImpl extends
        AbstractSingleService<DistributorManager> implements
       CustomerService {

    @SuppressWarnings("unused")
	private final Log logger = LogFactory
            .getLog(CustomerServiceImpl.class);

	@Override
	public List<Customer> getCustomerByDistributorCode(String code) {
		List<Customer> result = duplicateExcludeFields(getServerManager().getCustomerByDistributorCode(code));
		return result;
	}

	@Override
	public Customer saveOrUpdateCustomer(Customer customer) {
		Customer result = duplicateExcludeFields(getServerManager().saveOrUpdateCustomer(customer));
    	return result;
	}

	@Override
	public void deleteCustomer(int id) {
		getServerManager().deleteCustomer(id);
	}
}
